package cn.mazexal.exambg.common.mapstruct;


import cn.mazexal.exambg.common.models.Amount;

import java.math.BigDecimal;

/**
 * Amount 转换映射
 *
 * @author Lay
 * @date 2024/8/1
 */
public interface AmountMapper {
    static BigDecimal mapToBigDecimal(Amount amount) {
        if (amount == null) {
            return null;
        }
        return amount.getValue();
    }

    static Amount mapToAmount(BigDecimal amount) {
        if (amount == null) {
            return null;
        }
        return new Amount(amount);
    }
}
